home *** CD-ROM | disk | FTP | other *** search
Text File | 1991-03-03 | 3.9 KB | 109 lines | [TEXT/MACA] |
- ( SetSoundVol - White Knight procedure and RCMD
- ( to set the Macintosh speaker volume
-
- ( This absolutely simple and mindless :-) procedure sets the speaker
- ( volume level. It also returns the previous speaker volume level.
- ( I wrote this because I wanted to keep my speaker volume set at 0
- ( (flashing menu bar only) during most operations, but wanted to
- ( occasionally set the speaker volume to a higher level to alert me when
- ( I was away from the computer while waiting for a long downloading
- ( session to finish or while waiting to log into a busy BBS or campus
- ( computer system.
-
- ( -----
-
- ( NOTE:
-
- ( This text file contains an RCMD resource in its resource fork.
- ( Make a backup copy of this file before editing it with any
- ( text editor or word processor which removes the resource fork
- ( from text files in the process of saving them.
-
- ( A compiled copy of the procedure below is provided as the
- ( file, "SetSoundVol.PROC." This text file, "SetSoundVol", is
- ( the source file from which White Knight generated that compiled procedure.
-
- ( -----
-
- ( SUMMARY:
-
- ( Sets the speaker volume to the value of the variable S9%.
- ( Returns the previous speaker volume in the variable S8%.
-
- ( Returns a result code in the variable S7%:
- ( 0 if the speaker volume was successfully set to the new level.
- ( -1 if the speaker volume could not be set to the requested level.
- ( (This would either be due to the speaker volume requested being
- ( outside the permissible range of 0 to 7, or if for some reason
- ( SetSoundVol failed to change the speaker volume.)
- ( -87 if the speaker volume could not be successfully written to
- ( parameter RAM (PRAM) (i.e. could not be read-verified).
-
- ( This procedure *insists* on using these specific variables--S7%, S8%,
- ( and S9%. If you have any values set for the variables S7% and S8%
- ( before calling this procedure, they are likely to be changed afterwards.
-
- ( It is good practice to return the speaker volume to its previous level
- ( after you have finished taking advantage of the new speaker volume
- ( in your procedures.
-
- ( The following is one example of how you might call this procedure
- ( from your own White Knight procedures. (Substitute the full pathname
- ( to this file, or the pathname from the folder where White Knight is
- ( located, for every instance of "PathtoSetSoundVolfile" below.):
-
- ( --- Insert commands like the following into your own procedures: ---
-
- ( ( Change the speaker volume to 5 by putting this value
- ( ( into S9% and calling the nested procedure, SetSoundVol.
- ( LET EQUAL S9%,5
- ( NEST PathtoSetSoundVolfile:SetSoundVol.PROC
-
- ( ( Make some noise, using the new speaker volume.
- ( BELL
- ( BELL
-
- ( ( Return the speaker volume to its previous level,
- ( ( which was returned in S8%.
- ( LET EQUAL S9%,S8%
- ( NEST PathtoSetSoundVolfile:SetSoundVol.PROC
-
- ( -----
-
- ( COPYRIGHT AND DISCLAIMER
-
- ( Copyright ©1991 by Aron Roberts.
- ( May be freely distributed and used for any non-commercial and
- ( commercial purposes. If you modify this RCMD or procedure and
- ( distribute the modified version, please add your own name to
- ( the modified copies.
-
- ( Tested only on a Mac IIcx using System 6.0.7 and one specific
- ( set of INITs, so use at your own risk. This RCMD does not try
- ( to do anything ambitious, however, so the risk should be minimal.
-
- ( Please send bug reports, suggestions for enhancements to:
- ( Preferred addresses:
- ( Internet: aron@garnet.berkeley.edu, BITNET: aron@ucbgarne.bitnet
- ( Also:
- ( CompuServe: 73075,1342, GEnie: ARON, America OnLine: ARON
-
- ( Version 1.1, 3 March 1991.
- ( Now writes changed speaker volume setting to parameter RAM (PRAM).
-
- ( Previous releases:
- ( Version 1.0, 2 March 1991.
-
- ( Thanks to Doug Acker and Robert A. Daniel for the Think Pascal RCMD shell.
-
-
- ( -----
-
- ( The actual commands in this procedure follow:
-
- ( Call "SetSoundVol", the RCMD code resource contained in
- ( the resource fork of this file, with resource ID 280.
- RCMD 1,280
-
- ( End the nested procedure.
- NESTEND